package com.example.bzh.gamecat.httputils.hotlive;

import com.example.bzh.gamecat.config.HttpUrl;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;


/**
 * Created by peter on 2016/8/17.
 */
public class HotHttpHelper {

    private static HotHttpHelper helper;
    private Retrofit retrofit;
    private IHotService service;

    private HotHttpHelper(){
        retrofit = new Retrofit.Builder()
                .baseUrl(HttpUrl.BASE_URL)
                .addConverterFactory(new HotConvertFactory())
                .build();
        service = retrofit.create(IHotService.class);
    }

    public IHotService getService(){
        return service;
    }

    public static synchronized HotHttpHelper newInstance() {
        if (helper == null) {
            helper = new HotHttpHelper();
        }
        return helper;
    }
}
